package com.zit.java.zhifu;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000119620928";

	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCC277PpOdWuhPrTh1ylIAHDlt9SvEirdL9oUTjYQ20edNsTYu87V6kgOIHcQbpMsOhHlgZCizpUhy6ZcBpJWUkUHaeFIjqvXHcn09PNAUb5WUqptImvfLB6PbsXzVj7+7x9m4W4qdh153OHeIDNBSQdTPlgQ7/o7O6lIeMdy6Ed1Lr1RqJi8xoTuV1TFtC4+Z0u7wzx3Amdv8MYfFz+8m6XpLFxUahj64zZFmj47OTNQWx+ya7zvOD6wjoKJnh1wjtQlwAINOyQOcOclf8q2ClgjayD0zv7msVyRqQJK2PzibeBnnv6XDwSyMxfUNamMkl1u15ItQk9otvSvfdfcyPAgMBAAECggEAJwkiTJLmp8pucr0kr6942aIAzMl0UWIFFL/s6t9i1TmaRi6DxuIQX4ZK5ulipGIOVZvVr/KHHzrtcvUzhqovF7whBlsd1NiahLPJVtkvxPiTSzvkaMY1Cn9SWYS1SpCieO+IO691Owy0+G2VpFr+33D3ADmVndDZpoj0PoS3DbCVfzmLHNV6PdUC7IgiBYLAdh19Fi1v4E+oETcIzkF4rojd025iH3fBim+8DBazl61S/Bt+754i9g7Ve0lVEfFHe4mT+1SACe+aBkd2K55k9C0fQmsmRTy2jgQ6Hm70VLPT27+/KHBIPhUr0Kn3O0WBdrwC04T1s80DpREsfooO8QKBgQC8a3434wH5gZsHSb0992UnaOc1TSjp+ATtsJIAwoYTC0w78UN9YRsMgs0FG7bIWSu28leaxdDkRKK/qL/D6v2hCftZRWsQ09UQUhxo8c1Y4d2jdqxGKM674g9SidoP5VEBtNBuROPoE+n7t/y1iLKRldOwR0sQ9SCPsqi3wdPABQKBgQCxywR9UcGKXbCwZbYnxnhAb5ymR6t1//CH4Ttrr+/tNbdueaCklrl/A0EBCvsjIsSu3uBYMkQbtfLWK6bzuYkd+JTgq+FtTYVSTFS5IXzIOLvqyedF8PYZO5kzPBipt6+oKkpAdpJl0Jod/wtHpIejVAUarvOjVKy+FhXobiCCgwKBgAJVop62pVOeE3mnpDycUBiI6DR03Ejp1cXMJkL0Jg0eWrdzac6n4VnqVPf3O/CHik8d+Y/lW404fHu7b4TR6IqSQRb+ETGILl+hZNC4Dj9HrSNVWRUVdFpHlsEDDDyeLr7CqsJzAA/kD0YbJXpqUywSmyjX+Uogf2LIZ+a+9AyxAoGAUBKrNvW3QOXpScjFPSy5w+uAlbL5me9nGQtrg5h9akwjDPJiUz4+1OFWSW30pWJnSoq+Z3pcCk7ry2Flk6cgBguKoZVHtb6QKPyPu8FFPbevipLcQje/3qVk3hpW0TkVN5u0TUwZqxlED/Zp0h5bqEeS9O2OdSURl5rCyyeuJJkCgYAS1RTuFviilmswaEsl9b1kquc7vwb1Iab50rBcA0PQaG2eJo2HelMHuXm3+sRH0FiiCSBVDHAgyMdD+q1P7jepmlHhYUUyMOxuTVLufGbs33MBuHe4lo5cXKDiBfmNxg1Q3EzCVuIOgv4T7/nmKjkUw1ZY3dXzym0W26n3Mb/UJA==";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhv1YUqc8DCUzEmdPPxtiLvxDPpvtLFekc7KyAKXecyMrhVaPMItfuNnhW4hXcyeXRX4rP3lYkYVtCjUItYaNeOpbrtL2s3WVqhl1PyJ0V0wNzX3unDu2OPyTSa/zwfaIXYUUEkRrN7e4Y5hfTlq5cjqqxT0AXHaPMUKOGWiNJO1VdYeElQriGNiGx9V+erYnEOLD3hccSmhQXxm5uxzBr9EIiHnBUHh43sfgHM/BwIQxPvS5OQ69rdRw1hR6+pgB+hTvuruXjDfE3sw7D3JOyXYgJ7VTgqMYBSDjWDMyIXFOzbJJkNtKyKhz17oY+ts35MlNfWEVTNurR+S1oVyaJQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/ssm/return";

	// 签名方式
	public static String sign_type = "RSA2";

	// 字符编码格式
	public static String charset = "utf-8";

	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do\n";

	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

